/*
 * @Author: HuangYue
 * @Date: 2022-02-26 19:17:10
 * @LastEditors: HuangYue
 * @LastEditTime: 2022-05-07 12:28:07
 * @FilePath: /graduation/config/routes.js
 * @Description:路由信息
 */
export default [
  // 登录页相关路由
  {
    path: '/user',
    layout: false,
    routes: [
      {
        path: '/user',
        routes: [
          {
            name: 'login',
            path: '/user/login',
            component: './user/Login',
          },
        ],
      },
      {
        component: './404',
      },
    ],
  },
  // 欢迎页面相关路由
  // admin欢迎页
  {
    path: '/AdminWelcome',
    name: 'welcome',
    icon: 'smile',
    access: 'canAdmin',
    component: './DataVisualization/Welcome/AdminWelcome',
  },
  // user 欢迎页
  {
    path: '/UserWelcome',
    name: 'welcome',
    icon: 'smile',
    access: 'canUser',
    component: './DataVisualization/Welcome/UserWelcome',
  },
  // 系统管理员角色 - 菜单树相关路由
  {
    path: '/admin',
    name: 'admin',
    icon: 'crown',
    access: 'canAdmin',
    routes: [
      {
        path: '/admin/hospitalManagement',
        name: 'hospitalManagement',
        icon: 'smile',
        component: './Admin/HospitalManagement',
      },
      {
        path: '/admin/peopleManagement',
        name: 'peopleManagement',
        icon: 'smile',
        component: './Admin/PeopleManagement',
      },
      // 设备列表相关路由（系统管理员专用）
      {
        icon: 'table',
        name: 'list.device-list',
        path: '/admin/deviceList',
        component: './Admin/DeviceManagement',
      },
      {
        component: './404',
      },
    ],
  },
  // 医院用户角色 - 菜单树相关路由
  {
    path: '/hospital',
    name: 'admin',
    icon: 'crown',
    access: 'canUser',
    routes: [
      {
        path: '/hospital/peopleManagement',
        name: 'peopleManagement',
        icon: 'smile',
        component: './Hospital/PeopleManagement',
      },
      // 设备列表相关路由（医院用户专用）
      {
        name: 'list.device-list',
        icon: 'table',
        path: '/hospital/deviceList',
        component: './Hospital/DeviceManagement',
      },
      {
        component: './404',
      },
    ],
  },
  // 设备详情相关路由
  {
    icon: 'table',
    hideInMenu: true,
    menuRender: false,
    path: '/deviceDetail/:id',
    component: '../components/DeviceDetail',
  },
  // 个人中心相关路由
  {
    name: 'account',
    icon: 'user',
    path: '/account',
    routes: [
      {
        name: 'center',
        icon: 'user',
        path: '/account/center',
        component: './user/Account/AccountCenter',
      },
      {
        name: 'settings',
        icon: 'user',
        path: '/account/settings',
        component: './user/Account/AccountSetting',
      },
    ],
  },
  // 欢迎页路由
  {
    path: '/',
    redirect: '/welcome',
  },
  // 404 报错路由
  {
    component: './404',
  },
];
